import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/Layout/index.vue'
export const ensycrouter = [
	{
		path: '/home',
		component: Layout,
		meta: {
			title: '模板页',
		},
		children: [
			{
				path: "/home/anymarie",
				name: 'anymarie',
				component: () => import("@/views/home/index.vue"),
				meta: {
					title: 'css知识留存',
					icon: 'location'
				},
			},
		],
	},
	// 入口设置
	{
		path: '/',
		redirect: "/home/anymarie",
	},
	{
		path: '/select',
		component: Layout,
		meta: {
			title: 'vue知识学习',
			icon: 'MessageBox'
		},
		children: [
			{
				path: "/select/index",
				name: 'select',
				component: () => import('@/views/select/index.vue'),
				meta: {
					title: '概述',
				},
			},
			{
				path: "/select/table",
				name: 'tables',
				component: () => import('@/views/select/table.vue'),
				meta: {
					title: '选项卡 定义数据',
				},
			},
			{
				path: "/select/created",
				name: 'created',
				component: () => import('@/views/select/created.vue'),
				meta: {
					title: '生命周期对比',
				},
			},
			{
				path: "/select/computed",
				name: 'computed',
				component: () => import('@/views/select/computed.vue'),
				meta: {
					title: '计算属性',
				},
			},
			{
				path: "/select/watch",
				name: 'watch',
				component: () => import('@/views/select/watch.vue'),
				meta: {
					title: 'watch监听',
				},
			},
			{
				path: "/select/components",
				name: 'components',
				component: () => import('@/views/select/components.vue'),
				meta: {
					title: 'components组件',
				},
			},
			{
				path: "/select/music",
				name: 'music',
				component: () => import('@/views/select/music.vue'),
				meta: {
					title: '音乐播放器',
				},
			},
		],
	},
	{
		path: '/about',
		component: () => import('../views/AboutView.vue'),
		meta: {
			title: '关于页面',
			icon: 'List'

		}
	}
]
const router = createRouter({
	history: createWebHistory(import.meta.env.BASE_URL),
	routes: ensycrouter
})

export default router